<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0"/>
    <title>商品详情页</title>
    <link rel="stylesheet" href="lib/bootstrap/css/bootstrap.css">
    <link rel="stylesheet" href="css/commm.css"/>
    <link rel="stylesheet" type="text/css" href="font/iconfont/iconfont.css">
    <link rel="stylesheet" href="css/getbrand.css">
</head>
<body>
  <header  class="header">
    <div class="top clearfix">
      <div class="hd_left"><img src="images/header_logo.png" alt=""></div>
      <div class="hd_right"><img src="images/header_app.png" alt=""></div>
    </div>
    <div class="input">
        <input type="search" placeholder="请输入你要搜索的文字">
        <a href="#"><span class="sousuo">搜索</span></a>
    </div>
  </header>
    <h3 class="line">平板电视那个好？</h3>
    <div class="bd">
      <ul id="bd">
        <a href="#"><li>
          <em>1</em>
          <div class="inner">
            <div class="tit">三星液晶电视</div>
            <p>30天全网销量：218474件</p>
          </div>
        </li></a>
        <a href="#"><li></li></a>
        <a href="#"><li></li></a>
        <a href="#"><li></li></a>
        <a href="#"><li></li></a>
        <a href="#"><li></li></a>
        <a href="#"><li></li></a>
        <a href="#"><li></li></a>
        <a href="#"><li></li></a>
        <a href="#"><li></li></a>
        <a href="#"><li></li></a>
        <a href="#"><li></li></a>
      </ul>
    </div>
  <div class="discount clearfix">
    <div class="login">
        <ul>
          <a href=""><li>登录</li></a>
          <a href=""><li class="mid">注册</li></a>
          <a href="#"><li>返回首页</li></a>
        </ul>
    </div>
  </div>
    <p class="bot"><span class="reds">手机app下载</span> 慢慢买手机版 -- <span class="grays">掌上比价平台</span></p>
    <p class="bot">m.manmanbuy.com</p>
    </body>
    <script src="js/jquery.js"></script>
    <script src="js/template.js"></script>
    <script type="text/html" id="brand">
        {{if result}}
        {{each result as value}}
          <a href="getbrandproductlist.html?brandtitleid={{value.brandId}}"><li>
          <em>i</em>
          <div class="inner">
            <div class="tit">{{value.brandName}}</div>
            <p>{{value.brandInfo}}</p>
          </div>
        </li></a>
        {{/each}}
        {{/if}}
    </script>
    <script>
    var adr = window.location.search;
    console.log(adr);
      $.ajax({
        url:"http://192.168.23.25:3000/api/getbrand"+adr+"",
        type:'get',
        datatype:'jsonp',
        success:function(data){
            var html = template("brand",data);
            $("#bd").html(html);
            $("#bd").children().eq(0).find("em").css("background","red");
            $("#bd").children().eq(1).find("em").css("background","orange");
            $("#bd").children().each(function(i,v){
                $(this).find("em").text(i);

            })
            // $("#bd:nth-child(1)").find("em").css("background","red");
            // $("#bd").children().each(function(i,v){
            //       $("#bd").
            // })
            // $("#bd:nth-child(2)").find("em").css("background","orange");
        }
      })
    </script>
    </html>

